<template>
	<i class="iconfont icon-container" :class="fontClass"></i>
</template>

<script>
//存放所有图标的对象
const classMap = {
	home: "icon-zhuye",
	success: "icon-zhengque",
	error: "icon-cuowu",
	close: "icon-guanbi",
	warn: "icon-jinggao",
	info: "icon-xinxi",
	blog: "icon-blog",
	code: "icon-code",
	about: "icon-set_about_hov",
	weixin: "icon-logo-wechat",
	mail: "icon-youxiangsel",
	github: "icon-github1",
	qq: "icon-QQ-circle-fill",
	arrowUp: "icon-arrow-up",
	arrowDown: "icon-arrow-down",
	empty: "icon-empty",
	chat: "icon-liuyan",
};

export const fontclass = Object.keys(classMap);
export default {
	//图标组件
	props: {
		type: {
			type: String,
			required: true,
		},
	},
	computed: {
		fontClass() {
			return classMap[this.type];
		},
	},
};
</script>

<style scoped>
@import "//at.alicdn.com/t/font_3377902_jhv154cv6.css";
.iconfont {
	color: inherit;
	font-size: inherit;
}
</style>
